package com.yupi.security;

/**
 * @Author FengHuan Wang
 * @Date 2025/3/11 9:38
 * @Version 1.0
 */

import java.security.Permission;

/**
 * 禁用所有权限Java安全管理器
 */
public class DefaultSecurityManager extends SecurityManager{

    /**
     * 检查所有权限
     * @param perm   the requested permission.
     */
    @Override
    public void checkPermission(Permission perm) {
        System.out.println("默认不做任何权限限制");
        super.checkPermission(perm);
        throw new SecurityException("权限不足" + perm.toString());
    }
}
